<template>
  <div class="send-node">
    <div class="node-content">
      <div class="node-icon">
        <el-icon><Message /></el-icon>
      </div>
      <div class="node-label">抄送</div>
      <div class="node-details">
        <span class="recipients">{{ recipients || '请选择抄送人' }}</span>
      </div>
    </div>
    <Handle
      type="target"
      :position="Position.Top"
      :style="{ background: '#faad14' }"
    />
    <Handle
      type="source"
      :position="Position.Bottom"
      :style="{ background: '#faad14' }"
    />
  </div>
</template>

<script setup lang="ts">
import { Handle, Position } from '@vue-flow/core'
import { Message } from '@element-plus/icons-vue'

// 定义props
const props = defineProps<{
  data?: {
    recipients?: string
  }
}>()

const recipients = props.data?.recipients || ''
</script>

<style scoped>
.send-node {
  background: white;
  border: 2px solid #faad14;
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 140px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  position: relative;
}

.node-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.node-icon {
  width: 32px;
  height: 32px;
  background: #faad14;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.node-label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.node-details {
  font-size: 12px;
  color: #666;
  background: #fffbe6;
  padding: 4px 8px;
  border-radius: 4px;
  max-width: 100%;
  word-break: break-all;
}

.recipients {
  display: block;
}
</style>
